package com.sdk.es.sdk.constants;

import java.util.ArrayList;
import java.util.List;

/**
 * @author limaosheng
 * @create 2023-08-15 16:27
 * @desc es索引
 */
public class IndexConts {
    public static final String TEST1 = "test1";
    public static final String TEST2 = "test2";
    public static final String TEST3 = "test3";
    /**
     * 索引包括本身的，后续新增的索引默认统一拼接了年月，所以无需再配置
     * 例如：test1,test1_2025-02
     * @author limaosheng
     * @create 15:03 2023/8/25
     * @param
     */
    public static Boolean hasCurrentIndex(String index){
        List<String> list = new ArrayList<>();
        list.add(TEST1);
        return list.contains(index);
    }
    /**
     * 索引只有本身的，没有拼年月的索引
     * @author limaosheng
     * @create 15:03 2023/8/25
     * @param
     */
    public static Boolean onlyCurrentIndex(String index){
        List<String> list = new ArrayList<>();
        list.add(TEST2);
        return list.contains(index);
    }
    /**
     * 能力开放索引
     * 该索引拼接的年月没有中横杠，格式为：yyyyMM
     * test_202502
     * @author limaosheng
     * @create 10:47 2024/4/30
     * @param index
     */
    public static Boolean specialLast(String index){
        List<String> list = new ArrayList<>();
        list.add(TEST3);
        return list.contains(index);
    }
}
